package com.lizeng.manage.permission;

import java.util.List;

import org.springframework.web.servlet.tags.RequestContextAwareTag;

import com.lizeng.manage.pojo.JuriGroup;
import com.lizeng.manage.utils.ManageUtils;

/**
 * 权限标签
 * 
 * @author 符冬
 * 
 */
public class PermissionTag extends RequestContextAwareTag {
	private static final long serialVersionUID = 7784973765917150821L;
	private String value;

	@Override
	protected int doStartTagInternal() throws Exception {
		List<JuriGroup> jglist = (List<JuriGroup>) this.pageContext
				.getSession().getAttribute(
						ManageUtils.INIT_RB.getString("group.perm"));
		for (JuriGroup jg : jglist) {
			if (this.value.trim().equals(jg.getActionValue())) {
				return 1;
			}
		}
		return 0;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

}
